package com.yvtian.inv.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yvtian.inv.pojo.InvMaterialRequestItemEntity;
import com.yvtian.inv.dao.InvMaterialRequestItemMapper;
import com.yvtian.inv.service.InvMaterialRequestItemService;
import com.yvtian.utils.StringHelper;
import org.springframework.stereotype.Service;

/**
 * 领料单明细(inv_material_request_item)表服务实现类
 *
 * @author long
 * @since 2024-07-02 13:43:37
 */
@Service("invMaterialRequestItemService")
public class InvMaterialRequestItemServiceImpl extends ServiceImpl<InvMaterialRequestItemMapper, InvMaterialRequestItemEntity> implements InvMaterialRequestItemService {

    @Override
    public IPage<InvMaterialRequestItemEntity> findByPage(Page<InvMaterialRequestItemEntity> page, InvMaterialRequestItemEntity invMaterialRequestItemEntity) {
        LambdaQueryWrapper<InvMaterialRequestItemEntity> queryWrapper = new LambdaQueryWrapper<>();
        if (StringHelper.isNotEmpty(invMaterialRequestItemEntity.getZcode())) {
            queryWrapper.eq(InvMaterialRequestItemEntity::getZcode, invMaterialRequestItemEntity.getZcode());
        }
        return this.page(page, queryWrapper);
    }
}

